import {Service} from "adajs";
import {format} from "./../../../lib/helper";

class CourseService extends Service {
	defaultData() {
		return {
			list: []
		}
	}

	onupdate(current, {list}) {
		current.list = list.map(item => {
			return Object.assign({}, item, {
				time: item.jssj ? format(new Date(item.jssj.replace(/\-/g,"/")),'yyyy-MM-dd') : '--'
			})
		});
	}
}

export default CourseService;